<!DOCTYPE html>
<html>
<head>
    <title>督察模板表</title>
    <#include "/header.html">
        <link rel="stylesheet" href="${request.contextPath}/statics/css/index.css">
        <link rel="stylesheet" href="${request.contextPath}/statics/css/dczx.css">
        </head>
<body>
<div id="rrapp">
    <div class="content">
    	<input id="id" type="hidden" value="${id!''}" />
        <h3 class="content-title clearfix" v-cloak v-if="!isList">
            {{pageTitle}}
            <i class="el-icon-back pull-right" @click.stop="cancel"></i>
        </h3>
        <!--专项数据表格-->
        <div class="content-box clearfix" v-cloak v-if="isList">
            <div class="top-form-box clearfix">
                <div class="input-box pull-right clearfix">
                    <el-input class="pull-left" placeholder="请输入内容" v-model="findKey" @keyup.enter="search" clearable size="small" style="width: 200px;margin-right: 10px"> </el-input>
                    <el-button class="pull-left" type="primary" round size="small" @click="search">查询</el-button>
                    <div class="tpl-type-add pull-left">
                    	<#if shiro.hasPermission("business:instructions:save")>
                        <span class="add-pro" @click.stop="addInstructions"><i class="fa fa-plus"></i></span>
                        </#if>
                    </div>
                </div>
            </div>
            <el-table :data="tableData" border>
                <el-table-column
                    type="index"
                    :index="indexMethod"
                    width="50">
                </el-table-column>
                <el-table-column
                        align="center"
                        prop="receiveStatus"
                        label="状态"
                        width="120px"
                        :filters="[{ text: '未签收', value: '0' }, { text: '已签收', value: '1' }, { text: '已完成', value: '2' }, { text: '进行中', value: '3' }]"
                        :filter-method="filterReceiveStatus"
                        :filter-multiple=false
                        :formatter="formatStatus">
                </el-table-column>
                <el-table-column header-align="center" align="left" prop="titleName" label="标题">
                </el-table-column>
                <el-table-column align="center" width="100px" prop="createTime" label="发布时间">
                </el-table-column>
                <!--<el-table-column prop="status" label="发布单位">
                </el-table-column>-->
                <el-table-column header-align="center" align="left" prop="fbfw" label="接收单位">
                </el-table-column>
                <el-table-column
                        header-align="center"
                        align="right"
                        prop="level"
                        width="100px"
                        label="重要度"
                        :filters="[{ text: '普通', value: '0' }, { text: '紧急', value: '1' }]"
                        :filter-method="filterLevel"
                        :filter-multiple=false
                        :formatter="formatLevel">
                    <template slot-scope="scope">
                        <div slot="reference" class="name-wrapper">
                            <span v-if="scope.row.level == 0" style="color:#40c8ff"><i class="el-icon-remove-outline"></i></span>
                            <span v-if="scope.row.level == 0">普通</span>
                            <span v-if="scope.row.level == 1" style="color:red"><i class="el-icon-warning"></i></span>
                            <span v-if="scope.row.level == 1">紧急</span>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="right" width="100px" label="操作">
                    <template slot-scope="scope">
                        <el-button size="mini" @click="handleView(scope.$index, scope.row)">查看</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="pagination-box pull-right">
                <el-pagination background layout="prev, pager, next" :page-size="pageSize" :current-page.sync="pageNo" :page-count="totalPage" @current-change="pageChange"></el-pagination>
            </div>
        </div>
        <!--指令详情-->
        <div class="content-box clearfix" v-cloak v-if="isDetail">
            <div class="item-title-row">
                <div class="item-title-row">
                    <div class="detail-box clearfix">
                        <div class="tpl-info pull-left clearfix">
                            <span class="tpl-icon pull-left"><img src=""></span>
                            <p class="tpl-infos pull-left">
                                <span class="tpl-title">{{instructionsTime}}&nbsp;&nbsp;{{instructionsTitle}}</span>
                                <span class="tpl-arg">
                                <span>{{instructionsCorp}}</span>
                                <span>{{instructionsUpdateTime}}</span>
                                <span class="status">{{instructionsStatus}}</span>
                            </span>
                            </p>
                        </div>
                        <div class="tpl-status-btn pull-right">
                            <el-button type="primary" size="small" id="qs" style="display:none;" icon="el-icon-edit-outline" @click="checkInstructions">签收</el-button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="item-info-row">
                <p class="row-title">指令内容</p>
                <p class="item-info">
                    {{itemInfos}}
                </p>
            </div>
            <div class="item-checked-row">
                <p class="row-title clearfix">签收记录<span class="numbers">{{checkedDw}}/{{amountDw}}</span></p>
                <div class="checked-box">
                    <div class="checked-left clearfix">
                        <span class="tag-label">已签收</span>
                        <span class="tag-box">
                            <span v-if="checkedDWData.length === 0">无</span>
                            <el-tag size="small" class="checkTag" type="info" v-for="item in checkedDWData" :key="item.id">{{item.deptName}}{{item.userName !== null ? '------' + item.userName : ''}}</el-tag>
                        </span>
                    </div>
                    <div class="checked-right clearfix">
                        <span class="tag-label">未签收</span>
                        <span class="tag-box">
                            <span v-if="unCheckedDWData.length === 0">无</span>
                            <el-tag size="small" class="checkTag" type="warning" v-for="item in unCheckedDWData" :key="item.id">{{item.deptName}}{{item.userName !== null ? '------' + item.userName : ''}}</el-tag>
                        </span>
                    </div>
                </div>
            </div>
        </div>
        <!--新增指令-->
        <div class="content-box clearfix" v-cloak v-if="isAdd">
            <div class="content-left">
                <el-form label-width="80px" class="clearfix"  ref="baseForm" :model="baseForm">
                    <template>
                        <el-form-item label="指令标题">
                            <el-input v-model="baseForm.titleName" @blur="checkLength()"></el-input>
                        </el-form-item>
                    </template>
                    <el-form-item label="紧急度">
                        <el-select v-model="baseForm.level" placeholder="请选择" class="title">
                            <el-option
                                v-for="item in levelOptions"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                            </el-option>
                        </el-select>
                        <el-radio class="is-message" v-model="baseForm.msgFlag" :label="1" @click.native.prevent="changeMessage(1)">短信通知</el-radio>
                    </el-form-item>
                    <el-form-item label="指令内容">
                        <el-input type="textarea" v-model="baseForm.zlxq"></el-input>
                    </el-form-item>
                    <el-form-item label="接收单位">
                        <template>
                            <div class="dw-list-box clearfix">
                                <div class="dw-type-list">
                                    <el-radio-group v-model="dwType" @change="changeDwType">
                                        <el-radio :label="0">条线单位</el-radio>
                                        <el-radio :label="1">非条线单位</el-radio>
                                    </el-radio-group>
                                </div>
                                <div class="dw-view-list">
                                    <h5 class="tpl-view-title">单位列表</h5>
                                    <el-tree
                                        class="view-tree"
                                        :data="fbfwList"
                                        :props="props"
                                        show-checkbox
                                        node-key="deptId"
                                        @check="handleCheckChange"
                                        @node-click="handleImportPerson"
                                        ref="fbfwTree"
                                        empty-text="暂无单位"
                                        check-strictly
                                    >
                                    </el-tree>
                                </div>
                                <div class="dw-checked-list">
                                    <h5 class="tpl-view-title">已选单位</h5>
                                    <el-tree
                                        :data="fbfwCheckedList"
                                        :props="props"
                                        node-key="deptId"
                                        ref="checkedTree"
                                        empty-text="暂无选中单位"
                                    >
                                    </el-tree>
                                </div>
                                <div class="dw-view-list">
                                    <h5 class="tpl-view-title" style="margin-top: 25px">{{nowCheckedDw}}-下属人员列表</h5>
                                    <el-tree
                                            class="person-view-tree"
                                            :data="fbfwPersonList"
                                            :props="props"
                                            show-checkbox
                                            node-key="userId"
                                            @check="handlePersonCheckChange"
                                            ref="fbfwPersonTree"
                                            empty-text="暂无下属人员"
                                            check-strictly
                                    >
                                    </el-tree>
                                </div>
                                <div class="dw-checked-list">
                                    <h5 class="tpl-view-title" style="margin-top: 25px">已选人员</h5>
                                    <el-tree
                                            :data="fbfwCheckedPersonList"
                                            :props="props"
                                            node-key="userId"
                                            ref="checkedPersonTree"
                                            empty-text="暂无选中人员"
                                    >
                                    </el-tree>
                                </div>
                            </div>
                        </template>
                    </el-form-item>
                    <el-form-item label="截止时间">
                        <el-date-picker
                            v-model="baseForm.hysj"
                            type="date"
                            format="yyyy-MM-dd"
                            placeholder="选择截止时间">
                        </el-date-picker>
                    </el-form-item>
                </el-form>
            </div>
        </div>
        <div class="content-btn-box" v-if="isAdd">
            <el-button plain size="medium" @click.stop="cancel">取消</el-button>
            <el-button type="primary" size="medium"  @click.stop="commit">发布</el-button>
        </div>
    </div>
</div>
<script src="${request.contextPath}/statics/plugins/element/index.js"></script>
<script src="${request.contextPath}/statics/js/modules/business/xzzl.js?_${.now?long}"></script>
</body>
</html>